import requests
# base_url = 'http://49.233.108.117:3000/api/v1'

# get请求

# r = requests.get(base_url+'/topics1')
# print(r)
# # print(r.json())
# print(r.status_code)
# print(r.url)
# print(r.content)
# print(r.text)

# post请求
# topic_url = base_url+'/topics'
# topic_data = {
#     'accesstoken':'012fbc6b-41a2-46fa-8789-f8017b549703',
#     'title':'ROSALIA',
#     'tab':'ask',
#     'content':'rosalia'
# }
# r = requests.post(url=topic_url,json=topic_data)
# print(r.status_code)
# print(r.json())
# print(r.request.headers)
"""
导入excel模块
"""
# from openpyxl import Workbook
#创建excel文件
# #创建workbook
# wb = Workbook()
# #激活workbook
# ws = wb.active
# #A1单元格赋值42
# ws['A1']=42
# #在A1下面添加一行数据
# ws.append([1,2,3])
# #修改A2的数据为当前时间
# import datetime
# ws['A2'] = datetime.datetime.now()
# #保存到文件
# wb.save('sample.xlsx')

#读取excel文件
from openpyxl import load_workbook

wb = load_workbook(filename='data/data.xlsx')
print(wb.worksheets)
ws = wb['topics']
# print(ws['B5'].value)
# print(len(tuple(ws.rows)))
test_data = []
for x in range(2,len(tuple(ws.rows))+1):
    testcase_data = []
    for y in range(2,7):
        testcase_data.append(ws.cell(row=x, column=y).value)
        print(ws.cell(row=x, column=y).value)
    test_data.append(testcase_data)
print(test_data)
